<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.fckeditor.net" prefix="FCK"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title><s:property value="title"/></title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	
	<link href="css/bbs.css" rel="stylesheet" type="text/css"/>
	<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> 
    <link href="css/AeroWindow.css?r=123" rel="stylesheet" type="text/css"/>
    
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>   
    <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script> 
    <script type="text/javascript" src="js/jquery-ui-1.8.1.custom.min.js"></script> 
    <script type="text/javascript" src="js/jquery.easing.1.3.js"></script>         
    <script type="text/javascript" src="js/jquery-AeroWindow.js"></script>
    
    <script type='text/javascript' src='/sjzl/dwr/interface/CheckTextNull.js'></script>
	<script type='text/javascript' src='/sjzl/dwr/engine.js'></script>
	<script type='text/javascript' src='/sjzl/js/util.js'></script>
    
    <style type="text/css">
    	.rReply_div {
			width: 80%;
			background-color: #ecefef;
			margin: 20px;
			border: 2px solid;
			filter: progid:DXImageTransform.Microsoft.Shadow(color='red', Direction=190, Strength=6);
			-moz-box-shadow: -1px 0px 20px red;
			-webkit-box-shadow: -1px 0px 20px red;
			box-shadow: -1px 0px 20px red;
		}
    </style>
	
	<script type="text/javascript">
		$(document).ready(function() {
			$('#chick_show_window').click(function() {
	          $('#window').AeroWindow({
	            WindowTitle:          '查看原帖相关信息',
	            WindowPositionTop:    'center',
	            WindowPositionLeft:   'center',
	            WindowWidth:          550,
	            WindowHeight:         300,
	            WindowAnimationSpeed: 1000,
	            WindowAnimation:      'easeOutElastic',
	            WindowResizable : false,
				WindowDraggable : true,
				WindowMinimize : false,
				WindowMaximize : true,
				WindowClosable : true
	          });
	        })
		});
		function checkInputEdit() {
			var inputEditor=document.getElementById("inputEditor").value;	
			if(inputEditor=="false"){
				art.dialog({
					lock: true,
    				content: '要求输入的内容不能为空！'
				});
				return false;
			}return true;
			
		}
		function checkText() {
			var oEditor=FCKeditorAPI.GetInstance('input_edit');
			var OEditor="&nbsp;"+oEditor.GetXHTML(true);
			CheckTextNull.checkInputEdit(OEditor,function(data){
				document.getElementById("inputEditor").value=data;
			});
		}
	</script>
	
  </head>
  
  <body>
  	<s:include value="/top.jsp"></s:include>
  	
  	<!-- 导航条 -->
    <div class="nav_div">
	    <div style="width: 940px; margin: auto; position: relative;">
	    	<span>
	    		对--【${ reply.name }】--回帖进行回复 --<span style="color: red;">尽量不要提交太多内容，我们做了限制，不能上传自己的图片</span>--
	    		<span><a style="cursor: pointer;" id="chick_show_window">查看原帖内容以及相关回复</a></span>
	    	</span>
	    </div>
	</div>
  	
  	<br/><br/>
  	<div class="main_div">
  		<br/>
    		<div class="module_div">
    			<div style="width: 100%; height: 30px; background-repeat: repeat-x;">
		    		<br/>
		    	</div>
		    	
		    	<s:form action="reply_createRReply">
		    		<s:hidden name="post_id" value="%{#request.post_id}"></s:hidden>
		    		<s:hidden name="reply_id" value="%{#request.reply_id}"></s:hidden>
		    		<FCK:editor instanceName="input_edit" inputName="reply.content" basePath="/fckeditor" toolbarSet="One" height="320px;" width="100%">
			    		<jsp:attribute name="value"></jsp:attribute>
			    	</FCK:editor>
			    	<s:hidden id="inputEditor" value=""></s:hidden>
			    	<s:submit value="提  交" cssStyle="width: 80px; height: 30px;" onmouseover="checkText()" onclick="return checkInputEdit()"></s:submit>
		    	</s:form>
    		</div>	
    	<br/>	
  	</div>
  	
  	<!-- 隐藏的窗口 -->
  	<div id="window" style="display: none;">
  		<div style="width: 100%;">
  			<span>
  				${reply.content}
  			</span>
  		</div>
  		<br/>
    	<c:forEach var="reply" items="${ reply.subReply }">
			<div class="rReply_div">
				<table style="border: 0px;">
					<tr>
						<td><img src="images/bbs/rReply_icon.png"/></td>
						<td style="width: 100%;">
						回复者：${reply.user.account}
						回复时间：${reply.dateCreated}
						</td>
					</tr>
				</table>
				回复内容：${reply.content}
			</div>
		</c:forEach>
    </div>
  	
	<s:include value="/bottom.jsp"></s:include>
  </body>
</html>
